package com.itheima.mapper;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {

    // 查询全部
    @Select("select * from student")
    public abstract List<Student> selectAll();

    // 添加数据
    @Insert("insert into student values (#{number},#{name},#{birthday},#{address})")
    public abstract void addStu(Student stu);

    // 修改数据
    @Update("UPDATE student SET number=#{number},name=#{name},birthday=#{birthday},address=#{address} WHERE number=#{number}")
    public abstract void updateStu(Student stu);

    // 删除数据
    @Delete("delete from student where number=#{number}")
    public abstract void deleteStu(String number);
}
